<%--
  Created by IntelliJ IDEA.
  User: yinshankun
  Date: 2020/11/4
  Time: 14:58
  To change this template use File | Settings | File Templates.尹山坤
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath();%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>测试</title>
    <script type="text/javascript" src="<%=path%>/ysk/js/jquery-3.5.1.min.js"></script>
</head>
<body>
111111111111
<input type="button" id="btn" value="确定">
${sessionScope.loginUser.userName}
${sessionScope.phonennn}

<input type="text" id="num" value="60"><input type="button" id="but" value="开始">

</body>
</html>
<script>

    $(function () {
        $("#btn").click(function () {
            var str = '0123456789';
            var code = '';
            for (i = 0; i < 6; i++) {
                var n = parseInt(Math.random() * str.length)
                code += str[n]
            }
            alert(code);
        })
    })


</script>
<script>
    $(function () {
    $("#but").click(jishi);

    })
    function start() {


    var num=$("#num").val()
        num=num-1;


        $("#num").val(num);

    }
    var t;
    function jishi()
    {
        t = setInterval(start,1000);
        //每隔1s调用一次add方法
    }


</script>

